package transormatic_date;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Author: Daniel
 * Date: 19.09.13
 */

public class Transformatic {
    public String transformData(final Object[] data, final String pattern) {
        Date date = (Date) data[0];
        int percantage = (Integer) data[1];
        StringBuilder resultLine = new StringBuilder("['");
        resultLine.append(new SimpleDateFormat(pattern).format(date));
        resultLine.append("',");
        resultLine.append(percantage);
        resultLine.append("%]");
        return resultLine.toString();
    }
}
